@import url(../../reset.css);

#box {
  width: 300px;
  height: 300px;
  counter-reset: num;
}

#box > div {
  width: 100px;
  height: 100px;
  border: 1px solid #000;
  counter-increment: num;
  float: left;
  text-align: center;
  line-height: 100px;
  font-weight: bold;
}

/* 1、id为box的元素它的所有子元素div都应该有一个伪元素 */
#box div::after{
  content: counter(num);
}

/* 2、获取id为box的元素它的所有奇数子元素div */
#box>div:nth-last-child(2n-1){
  color: red;
}